﻿namespace Hidistro.SaleSystem.Vshop
{
    using Hidistro.Entities.Orders;
    using Hidistro.SqlDal.Members;
    using Hidistro.SqlDal.Orders;
    using Hidistro.SqlDal.Promotions;
    using System;
    using System.Data;
    using System.Runtime.InteropServices;

    public static class MemberProcessor
    {
        public static bool ConfirmOrderFinish(OrderInfo order)
        {
            bool flag = false;
            if (order.CheckAction(OrderActions.BUYER_CONFIRM_GOODS))
            {
                order.OrderStatus = OrderStatus.Finished;
                order.PayDate = DateTime.Now;
                order.FinishDate = DateTime.Now;
                flag = new OrderDao().UpdateOrder(order, null);
            }
            return flag;
        }

        public static DataTable GetUserCoupons(int userId, int useType = 0)
        {
            return new CouponDao().GetUserCoupons(userId, useType);
        }

        public static int GetUserHistoryPoint(int userId)
        {
            return new PointDetailDao().GetHistoryPoint(userId);
        }

        public static DataSet GetUserOrder(int userId, OrderQuery query)
        {
            return new OrderDao().GetUserOrder(userId, query);
        }
    }
}

